1. Field of the Invention
The present invention relates to a Joint Photographic Experts Group Extended Range (JPEG-XR)-based image encoding method and an image encoding apparatus for realizing the same.
2. Description of the Related Art
JPEG-XR, a standard format for handling image data, was internationally standardized in 2009 to compensate for the lack of color information in JPEG. An image encoding apparatus or an image encoding sequence for converting raw image data into an encoded stream by JPEG-XR is shown in FIG. 1.
A digital input image captured by an imaging device is segmented into two-dimensional (2D) blocks. Data of each block undergoes orthogonal conversion from color-space data into a conversion coefficient in the frequency space. If necessary, the conversion coefficient may undergo quantization. When a data pattern of an image exists over multiple blocks, the strength of the conversion coefficient may be further reduced by predicting the quantized conversion coefficient within a frame according to each frequency band.
The 2D conversion coefficient having undergone quantization and coefficient prediction is rearranged in one-dimensional (1D) data such that a significant coefficient may continue forward and a run (zero) may continue backward. An encoded stream is created by entropy-encoding the rearranged 1D data.
The JPEG-XR image encoding scheme capable of changing a quantized value or a coefficient prediction method for each block may change a scan order for each block.
According to the JPEG-XR standard, the detailed structure and sequence of a scan converter for changing the scan order are as shown in FIGS. 2 and 3, respectively.
An operation thereof will be described in detail with reference to FIGS. 4 to 9.
A conversion coefficient corresponding to, for example, a 4×4 pixel shown in FIG. 4 may be considered as a data block, which is a processing unit.
The data block is a set of data corresponding to a pixel, and the upper left data is excluded. A value of each data represents a significant coefficient. As shown in the drawings, a data position (hereinafter block position) in the data block is represented by Pj (where j=1˜15).
FIG. 5 illustrates accumulated non-zero information (herein, a value obtained by uniformly accumulating significant coefficients as 1) of data for each block position in a previously scanned data block. This is a scan state, and represents an evaluation function for determining a scan order. The lower the scan order, the greater its value. In FIG. 5, the scan order is represented in block position.
It is assumed herein that a data block having the values shown in FIG. 6 is input.
Then, the scan converter converts only a coefficient of a block position (i.e., a data value), which is non-zero, into 1, and sequentially adds the converted coefficient to the accumulated non-zero information in the scan order. In this manner, the accumulated non-zero information may be updated as shown in FIG. 7.
Next, the scan converter individually compares values of block positions, which are adjacent to each other in scan order, in the accumulated non-zero information. The values are sequentially replaced to be in descending order (see FIGS. 8 and 9) when there exists a part where the values are in ascending order (the shaded parts in FIG. 7.
The order of block positions when all comparisons and replacements are completed (i.e., the scan order shown in FIG. 9) represents the scan order of the following input data block.
Therefore, the above structure cannot sequentially handle the data block because the scan order of the following data block is determined after the conversion of the preceding data block is completed. Thus, the processing is delayed after the scan conversion, and a digital camera is unable to increase its consecutive photographing speed to a desired value or more.
In order to solve this problem, Japanese Patent Publication No. 2010-193097 discloses that a parallel processing determination unit determines whether the scan order is unchanged as a result of the input of two successive data blocks, and if so, the parallel processing determination unit performs parallel processing in scan order. When there is a change in scan order, the parallel processing determination unit performs the conventional sequential processing.
However, a substantial improvement in processing speed does not result, because the processing speed is improved only when the scan order is unchanged.
If the amount of data block is increased to improve the processing speed by increasing the degree of parallelism, the scan order is likely to be changed, making it difficult to ensure the high processing speed.